CurrencyPositionRecordV5
CurrencyPositionRecords are live risk records that contain start-of-day positions and all subsequent transactions. These records are published by a CoreRiskServer and represent the position and risk markup detail for a single currency. New records are published immediately when a position changes and about once per minute if no position has changed.
METADATA
Attribute | Value |
---|---|
Topic | 4740-risk-v5 |
MLink Token | ClientRisk |
Product | SRRisk |
accessType | SELECT |
Table Definition
Field | Type | Key | Default Value | Comment |
---|---|---|---|---|
currency | enum - Currency | PRI | 'None' | |
accnt | VARCHAR(16) | PRI | '' | |
tradeDate | DATE | PRI | '1900-01-01' | |
clientFirm | VARCHAR(16) | PRI | '' | SR assigned client firm |
mnyOpnPosPrv | INT | 0 | startofday SR currency position rotated from prior day record | |
mnyOpnPosClr | INT | 0 | startofday CLR currency position supplied by clientclearing firm via clearing position load | |
mnyOpnPos | INT | 0 | start of period currency position effective can be from either CLR or SR | |
mnyOpnPosSrc | enum - PositionSource | 'None' | start of period position source | |
mnyBot | INT | 0 | currency units bot today | |
mnySld | INT | 0 | currency units sld today | |
numExecutions | INT | 0 | number of currency transactions included in mnyBot and mnySld today | |
maxExecDttm | DATETIME(6) | '1900-01-01 00:00:00.000000' | max timestamp of included currency transaction records | |
timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' |
PRIMARY KEY DEFINITION (Unique)
Field | Sequence |
---|---|
currency | 1 |
accnt | 2 |
tradeDate | 3 |
clientFirm | 4 |
CREATE TABLE EXAMPLE QUERY
CREATE TABLE `SRRisk`.`MsgCurrencyPositionRecordV5` (
`currency` ENUM('None','AUD','BRL','CAD','CHF','CNH','CNY','EUR','GBP','JPY','KRW','MXN','MYR','NOK','NZD','SEK','TRY','USD','USDCents','CZK','ZAR','HUF','USX','GBX') NOT NULL DEFAULT 'None',
`accnt` VARCHAR(16) NOT NULL DEFAULT '',
`tradeDate` DATE NOT NULL DEFAULT '1900-01-01',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR assigned client firm',
`mnyOpnPosPrv` INT NOT NULL DEFAULT 0 COMMENT 'start-of-day SR currency position (rotated from prior day record)',
`mnyOpnPosClr` INT NOT NULL DEFAULT 0 COMMENT 'start-of-day CLR currency position (supplied by client/clearing firm via clearing position load)',
`mnyOpnPos` INT NOT NULL DEFAULT 0 COMMENT 'start of period currency position (effective; can be from either CLR or SR)',
`mnyOpnPosSrc` ENUM('None','Zero','SR','CLR') NOT NULL DEFAULT 'None' COMMENT 'start of period position source',
`mnyBot` INT NOT NULL DEFAULT 0 COMMENT 'currency units bot today',
`mnySld` INT NOT NULL DEFAULT 0 COMMENT 'currency units sld today',
`numExecutions` INT NOT NULL DEFAULT 0 COMMENT 'number of currency transactions included in mnyBot and mnySld today',
`maxExecDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'max (timestamp) of included currency transaction records',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
PRIMARY KEY USING HASH (`currency`,`accnt`,`tradeDate`,`clientFirm`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='CurrencyPositionRecords are live risk records that contain start-of-day positions and all subsequent transactions.\nThese records are published by a CoreRiskServer and represent the position and risk markup detail for a single currency.\nNew records are published immediately when a position changes and about once per minute if no position has changed.';
SELECT TABLE EXAMPLE QUERY
SELECT
`currency`,
`accnt`,
`tradeDate`,
`clientFirm`,
`mnyOpnPosPrv`,
`mnyOpnPosClr`,
`mnyOpnPos`,
`mnyOpnPosSrc`,
`mnyBot`,
`mnySld`,
`numExecutions`,
`maxExecDttm`,
`timestamp`
FROM `SRRisk`.`MsgCurrencyPositionRecordV5`
WHERE
/* Replace with a ENUM('None','AUD','BRL','CAD','CHF','CNH','CNY','EUR','GBP','JPY','KRW','MXN','MYR','NOK','NZD','SEK','TRY','USD','USDCents','CZK','ZAR','HUF','USX','GBX') */
`currency` = 'None'
AND
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a DATE */
`tradeDate` = '2022-01-01'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
Doc Columns Query
SELECT * FROM SRRisk.doccolumns WHERE TABLE_NAME='CurrencyPositionRecordV5' ORDER BY ordinal_position ASC;